package javabase.obj;

class Cat {
	String name;
	int age;
	public Cat(String name, int age, float weight) {
		System.out.println("执行构造器;");
		System.out.println("执行构造器前：" + this.weight);
		this.name = name;
		this.age = age;
		this.weight = weight;
	}
	float weight = 2.3f;
	{
		System.out.println("执行非静态初始化快" + this.weight);
		weight=2.0f;
	}
	@Override
	public String toString() {
		return "Cat [name=" + name + ", age=" + age + ", weight=" + weight + "]";
	}
	
}
public class InitClass {
	public static void main(String[] args) {
		Cat cat = new Cat("kitty", 2, 5.5f);
		System.out.println(cat);
	}

}
